let introduction = document.getElementById('activity');
introduction.setAttribute('class', introduction.getAttribute('class') + ' active');

let courses_blocks = document.getElementsByClassName('courses');
for (let i = 0; i < courses_blocks.length; i++) {
    courses_blocks[i].addEventListener('click', () => {
        if (courses_blocks[i].getAttribute('courseid')){
                    location.href="/activity/course/detail?article="+courses_blocks[i].getAttribute('courseid');
        location.href.reload;
        }
    })
}

let project_develop_blocks = document.getElementsByClassName('project_develops');
for (let i = 0; i < project_develop_blocks.length; i++) {
    project_develop_blocks[i].addEventListener('click', () => {
        if (project_develop_blocks[i].getAttribute('project_develop_id')){
                    location.href="/activity/projectDevelop/detail?article="+project_develop_blocks[i].getAttribute('project_develop_id');
        location.href.reload;
        }
    })
}

let contest_blocks = document.getElementsByClassName('contests');
for (let i = 0; i < contest_blocks.length; i++) {
    contest_blocks[i].addEventListener('click', () => {
        if (contest_blocks[i].getAttribute('contestid')){
                    location.href="/activity/contest/detail?article="+contest_blocks[i].getAttribute('contestid');
        location.href.reload;
        }
    })
}